c###setluf.for
      SUBROUTINE SETLUF
C--------------------------------
C.....THIS SUBROUTINE SETS THE LUF USING THE FREQUENCY COMPLEMENT AND
C.....COMPUTED RELIABILITIES. THESE VALUES ARE CHANGED IN SUBROUTINE
C.....GETLUF IF THE LUF IS ACTUALLY COMPUTED
C
      COMMON/FRQ/FREA(13),FREL(29),FREQ,JMODE,ITXRCP(2)
      COMMON / ION / IHRE, IHRO, IHRS, LUFP, METHOD, NOISE, NPSL
      COMMON / MUFS / EMUF(24), F1MUF(24), F2MUF(24), ESMUF(24),
     A ALLMUF(24), FOT(24), XLUF(24), HPF(24), ANGMUF(24), MODMUF,
     B SIGL(4), SIGU(4), DELMUF(4), HPMUF(4), HTMUF(4), FVMUF(4),
     C AFMUF(4), NHOPMF(4), YFOT(4), YHPF(4), YMUF(4)
      COMMON / SON / ANGLE(13), ANGLER(13), CPROB(13), DBLOS(13),
     A DBLOSL(13), DBLOSU(13), DBU(13), DELAY(13), DBW(13), NHP(13),
     B XNYNOIS(13), PROBMP(13), RELIAB(13), SNDB(13), SNPR(13),
     C SNRLW(13), SNRUP(13), SPROB(13), VHIGH(13), RNEFF(13),MDL(13)
       CHARACTER MDL*1
      COMMON / TIME / IT, GMT, UTIME(24), GMTR, XLMT(24), ITIM, JTX
C
      RF = FREL(1)
      REL = RELIAB(1)
      PLUF = LUFP
      PLUF = 0.01 * PLUF
      DO 200 IF = 1,11
      IF(FREL(IF)) 200, 200, 105
  105 IF(RELIAB(IF) - PLUF) 115, 110, 110
  110 XLUF(IT) = FREL(IF)
      FREL(13) = FREL(IF)
      GO TO 205
  115 IF(RELIAB(IF) - REL) 200, 200, 120
  120 REL = RELIAB(IF)
      RF = FREL(IF)
  200 CONTINUE
      XLUF(IT) = - RF
      FREL(13) = RF
  205 CONTINUE
      RETURN
      END
C--------------------------------
